<?php
/*
* @User: 小灰灰 <762229008@qq.com>
* @Date: 2025-05-19
* @Time: 11:51:01
* @Info:
* Copyright (c) 2022~2025 https://xiaohuihui.cc All rights reserved.
*/

namespace app\api\controller;

use think\App;
use think\facade\Db;

class Index extends Base
{

    protected $noNeedLogin = ["index"];

    /**
     * 构造方法
     * @access public
     *
     * @param App $app App 对象
     */
    public function __construct(App $app)
    {
        parent::__construct($app);
    }

    public function index()
    {
        return $this->success('欢迎使用小灰灰博客API');
    }

    public function user()
    {
        $user = Db::name('user')->where('id', 1)->find();
        $this->success($user);
    }

}
